using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using CMS.Core.DataInterfaces;
using CMS.Core.Domain;
using CMS.Data;
using AjaxPro;
using CMS.Presenters.Views.Reports;

namespace CMS.Presenters.Presenters
{
    public class LookupVangLaiPresenter
    {
        IDonThuDao iDonThuDao;
        ILookupSourceView iLookupView;

        public LookupVangLaiPresenter()
        { 
        
        }

        public LookupVangLaiPresenter(ILookupSourceView iLookupView)
        {
            this.iLookupView = iLookupView;
            this.iLookupView.LinhVucs = new PhongBanDao().GetFieldEqualCriteria("TrangThai", true);
            this.iLookupView.LoaiDons = new LoaiDonDao().GetFieldEqualCriteria("TrangThai", true);
        }

        [AjaxMethod]
        public IList SearchDonThus(string type, String txt1,String txtNgay1, String txtNgay2,            
            String maPB, int maLoaiDon, int maDiaBan, int State,
            int min, int max
            )
        {
            this.iDonThuDao = new DonThuDao();
            return this.iDonThuDao.SearchDonThuVangLais(type, txt1, txtNgay1, txtNgay2,
               maPB, maLoaiDon, maDiaBan, State, min, max);
        }

        [AjaxMethod]
        public IList TotalSearchDonThus(string type, String txt1,
            String txtNgay1, String txtNgay2,String maPhongBan, int maLoaiDon, int maDiaBan, int State
            )
        {
            this.iDonThuDao = new DonThuDao();
            return this.iDonThuDao.TotalSearchDonThuVangLais(type, txt1, txtNgay1, txtNgay2,
                maPhongBan, maLoaiDon, maDiaBan, State);
        }       
    }
}
